/*
 * Copyright (c) 2018 maoyan.com
 * All rights reserved.
 *
 */
package com.darren.euc.util.haqi.request;


import com.alibaba.fastjson.JSON;
import org.apache.commons.lang.StringUtils;

/**
 * 在这里编写类的功能描述
 *
 * @author fangwenhao
 * @created 2018/4/11
 */
public class WorkFindOntimeRequest extends HaquRequest {

    /**
     * appCode	String	是	应用编码 查找指定应用下的记录
     start	String	否	开始时间：格式必须 yyyy-MM-dd
     end	String	否	结束时间: 格式必须 yyyy-MM-dd
     index	int	否	页码 默认为第一页
     size	int	否	页码大小 默认为20

     */

    private String appCode;
    private String start = "";
    private String end = "";
    private Long[] userIds;
    private int index = 1;
    private int size = 20;

    public String getAppCode() {
        return appCode;
    }

    public void setAppCode(String appCode) {
        this.appCode = appCode;
    }

    public String getStart() {
        return start;
    }

    public void setStart(String start) {
        this.start = start;
    }

    public String getEnd() {
        return end;
    }

    public void setEnd(String end) {
        this.end = end;
    }

    public Long[] getUserIds() {
        return userIds;
    }

    public void setUserIds(Long[] userIds) {
        this.userIds = userIds;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }


    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("");
        sb.append("appCode=")
                .append(appCode);
        sb.append("&start=")
                .append(start);
        sb.append("&end=")
                .append(end);
        if (userIds != null && userIds.length != 0){
            String userIdsStr = StringUtils.join(userIds, ",");
            sb.append("&userIds[]=")
                    .append(userIdsStr);
        }
        sb.append("&index=")
                .append(index);
        sb.append("&size=")
                .append(size);
        return sb.toString();
    }

}
